package com.example.mygreendao;

import android.content.Context;
import android.util.Log;

import com.example.mygreendao.Dao.DaoMaster;
import com.example.mygreendao.Dao.UserDao;

import org.greenrobot.greendao.database.Database;

public class CalendarOpenHelper extends DaoMaster.OpenHelper {

    private static final String TAG = "CalendarOpenHelper";

    public CalendarOpenHelper(Context context, String name) {
        super(context, name);
    }

    @Override
    public void onUpgrade(Database db, int oldVersion, int newVersion) {
        super.onUpgrade(db, oldVersion, newVersion);
        Log.i(TAG, "Upgrading schema from version " + oldVersion + " to " + newVersion);
        if (newVersion > oldVersion) {
            DBMigrationHelper.getInstance().migrate(db, UserDao.class);
        }
    }
}
